<?php
defined('_JEXEC') or die('Restricted access');
JToolBarHelper::title(JText::_('COM_JHTRAQ_VERSION_ADD_EDIT'), 'generic.png');
JToolBarHelper::save();
JToolBarHelper::cancel();

?>
<?php JHTML::_('behavior.tooltip'); ?>
<script language="javascript" type="text/javascript">
function submitbutton(pressbutton) {
	var form = document.adminForm;
	if (pressbutton == 'cancel') {
		submitform( pressbutton );
		return;
	}
	var r = new RegExp("[\<|\>|\"|\'|\%|\;|\(|\)|\&]", "i");
	
	// do field validation
	//if (trim(form.version.value) == "") {
	//	alert( "<?php echo JText::_( 'COM_JHTRAQ_MUST_NAME', true ); ?>" );
	//}else {
		submitform( pressbutton );
	//}
}
</script>
<form action="index.php?option=com_jhtraq&view=versions" method="post" name="adminForm">
<input type="hidden" name="task" value="" />
<input type="hidden" name="id" value="<?php echo (int)$this->version->id;?>" />

<table class="adminlist" cellpadding="1">
<tr>
	<td width="150"><label for="version"><?php echo JText::_('COM_JHTRAQ_VERSION');?></label></td>
	<td><input type="text" name="version" id="version" value="<?php echo @$this->version->version;?>" class="inputbox" /></td>
</tr>
<tr>
	<td width="150"><label for="project_id"><?php echo JText::_('COM_JHTRAQ_PROJECT');?></label></td>
	<td><select name="project_id" id="project_id" >
	<?php
	foreach(@$this->projects as $pid=>$pname)
	{
		echo '<option value="'.$pid.'" ';
		if($pid == @$this->version->project_id) echo 'SELECTED';
		echo '>' . $pname . '</option>';
	}
	?></select>
	</td>
</tr>

</table>
</form>